package com.ruanda.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruanda.domain.Member;
import com.ruanda.mapper.MemberMapper;
import com.ruanda.service.MemberService;
import com.ruanda.util.AuthUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 亦樂
* @description 针对表【member(用户表)】的数据库操作Service实现
* @createDate 2024-09-06 16:26:38
*/
@Service
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member>
    implements MemberService{
    
    @Autowired
    private MemberMapper memberMapper;

    @Override
    public Boolean modifyMemberInfoByOpenId(Member member) {
        String openId = AuthUtils.getMemberOpenId();
        return memberMapper.update(member, new LambdaQueryWrapper<Member>()
                .eq(Member::getOpenId, openId)) > 0;
    }
}




